package com.hedl.practice.diyJava.exception.nullpointer;

public class JavaAndNullPointerException {
    public static void main(String[] args) {

        /*String b = "HELLO";
        String c = "hello world";
        String s = null;
        String d = "";
        System.out.println(b.toLowerCase());        //字符串大写转换
        System.out.println(c.toUpperCase());        //字符串小写转换
        System.out.println(d);*/


        /**
         * NullPointerException是Java代码常见的逻辑错误，应当早暴露，早修复；
         *
         * 可以启用Java 14的增强异常信息来查看NullPointerException的详细错误信息。
         */
        Person p = new Person();
        System.out.println(p.address.city.toLowerCase());

    }
}

class Person{
    String[] name = new String[2];
    Address address = new Address();
}

class Address{
    String city;
    String street;
    String zipcode;
}